package com.weizai.carshop.model.dto;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.weizai.carshop.model.config.LocalDateTimeConfig;
import com.weizai.carshop.model.entiity.GoodsNorm;
import com.weizai.carshop.model.entiity.GoodsSwipeInfo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class GoodsInfoDto {

    private Long id;

    private Long cateId;

    private String title;

    private BigDecimal price;

    private Integer sale;

    private BigDecimal score;

    private Integer stock;

    private String description;

    private String banner;

    @TableField(typeHandler = JacksonTypeHandler.class)
    private GoodsSwipeInfo[] swipeInfo;

    @TableField(typeHandler = JacksonTypeHandler.class)
    private GoodsNorm[] goodsNorms;

    @JsonSerialize(using = LocalDateTimeConfig.LocalDateTimeSerializer.class)
    private Long createTime;

    @JsonSerialize(using = LocalDateTimeConfig.LocalDateTimeSerializer.class)
    private Long updateTime;
}
